# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
pkgname=kuserfeedback
pkgver=6.1.0
pkgrel=0
pkgdesc="Framework for collecting user feedback for applications via telemetry and surveys"
url="https://kde.org/products/frameworks/"
arch="all !armhf"
license="MIT"
depends_dev="
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/kuserfeedback.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kuserfeedback-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	# openglinfosourcetest requires OpenGL
	xvfb-run ctest --test-dir build --output-on-failure -E "openglinfosourcetest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
144b1576dccb9334405c6b92c58f0748f67f36b967aacdee9a15d0b758789133fe0dfccb2b4686b234ff167408ca68bc7961fa37fd8ca9cde6a59db95e00d5a0  kuserfeedback-6.1.0.tar.xz
"
